package com.czl.module_work.view

import android.content.Context
import android.widget.TextView
import androidx.appcompat.widget.AppCompatEditText
import com.czl.module_work.R
import com.lxj.xpopup.core.BottomPopupView

class ApplyAuditPop(val title: String, context: Context) : BottomPopupView(context) {
    private var mListener: (String) -> Unit = {}

    override fun getImplLayoutId(): Int = R.layout.work_dialog_apply_audit

    fun setFilterResultListener(listener: (String) -> Unit) {
        this.mListener = listener
    }

    override fun initPopupContent() {
        super.initPopupContent()
        val editContent = findViewById<AppCompatEditText>(R.id.edit_content)
        findViewById<TextView>(R.id.tv_1).text = title

        findViewById<TextView>(R.id.tv_cancel).setOnClickListener {
            dismiss()
        }

        findViewById<TextView>(R.id.tv_confirm).setOnClickListener {
            mListener.invoke(editContent.text.toString().trim())
            dismiss()
        }

    }

}